﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace RecruitStudents.Utility.Model
{

	/// <summary>
	/// 实体类TB_Sys_Role 。(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public class TB_Sys_Role : Entity 
	{
		public TB_Sys_Role():base("TB_Sys_Role") {    _RoleID=Guid.NewGuid().ToString();}

		#region Model
		private string _RoleID;
		private string _RoleName;
		private string _RoleRemark;
		private string _IsActive;
		private DateTime? _CreateDate;
		/// <summary>
		/// 角色ID
		/// </summary>
		public string RoleID
		{
			get{ return _RoleID; }
			set
			{
				this.OnPropertyValueChange(_.RoleID,_RoleID,value);
				this._RoleID=value;
			}
		}
		/// <summary>
		/// 角色名称
		/// </summary>
		public string RoleName
		{
			get{ return _RoleName; }
			set
			{
				this.OnPropertyValueChange(_.RoleName,_RoleName,value);
				this._RoleName=value;
			}
		}
		/// <summary>
		/// 角色描述
		/// </summary>
		public string RoleRemark
		{
			get{ return _RoleRemark; }
			set
			{
				this.OnPropertyValueChange(_.RoleRemark,_RoleRemark,value);
				this._RoleRemark=value;
			}
		}
		/// <summary>
		/// 是否有效
		/// </summary>
		public string IsActive
		{
			get{ return _IsActive; }
			set
			{
				this.OnPropertyValueChange(_.IsActive,_IsActive,value);
				this._IsActive=value;
			}
		}
		/// <summary>
		/// 创建时间
		/// </summary>
		public DateTime? CreateDate
		{
			get{ return _CreateDate; }
			set
			{
				this.OnPropertyValueChange(_.CreateDate,_CreateDate,value);
				this._CreateDate=value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.RoleID};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.RoleID,
				_.RoleName,
				_.RoleRemark,
				_.IsActive,
				_.CreateDate};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				this._RoleID,
				this._RoleName,
				this._RoleRemark,
				this._IsActive,
				this._CreateDate};
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(IDataReader reader)
		{
			this._RoleID = DataUtils.ConvertValue<string>(reader["RoleID"]);
			this._RoleName = DataUtils.ConvertValue<string>(reader["RoleName"]);
			this._RoleRemark = DataUtils.ConvertValue<string>(reader["RoleRemark"]);
			this._IsActive = DataUtils.ConvertValue<string>(reader["IsActive"]);
			this._CreateDate = DataUtils.ConvertValue<DateTime?>(reader["CreateDate"]);
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(DataRow row)
		{
			this._RoleID = DataUtils.ConvertValue<string>(row["RoleID"]);
			this._RoleName = DataUtils.ConvertValue<string>(row["RoleName"]);
			this._RoleRemark = DataUtils.ConvertValue<string>(row["RoleRemark"]);
			this._IsActive = DataUtils.ConvertValue<string>(row["IsActive"]);
			this._CreateDate = DataUtils.ConvertValue<DateTime?>(row["CreateDate"]);
		}
		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","TB_Sys_Role");
			/// <summary>
			/// 角色ID
			/// </summary>
			public readonly static Field RoleID = new Field("RoleID","TB_Sys_Role","角色ID");
			/// <summary>
			/// 角色名称
			/// </summary>
			public readonly static Field RoleName = new Field("RoleName","TB_Sys_Role","角色名称");
			/// <summary>
			/// 角色描述
			/// </summary>
			public readonly static Field RoleRemark = new Field("RoleRemark","TB_Sys_Role","角色描述");
			/// <summary>
			/// 是否有效
			/// </summary>
			public readonly static Field IsActive = new Field("IsActive","TB_Sys_Role","是否有效");
			/// <summary>
			/// 创建时间
			/// </summary>
			public readonly static Field CreateDate = new Field("CreateDate","TB_Sys_Role","创建时间");
		}
		#endregion


	}
}

